package com.wx.activitframework.dao;

import java.util.List;

import com.wx.activitframework.entity.Permission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;


public interface PermissionDao extends JpaRepository<Permission, Integer>{
	
	@Query(nativeQuery=true,value="select p.* from sys_user u,sys_user_role ur,sys_role_permission rp,sys_permission p where u.id=ur.user_id and ur.role_id=rp.role_id and rp.permission_id=p.id and u.user_name=?1")
	List<Permission> getPermissionsByUserName(String userName);

}
